const koa = require('koa')
const useRouter = require('./routes/index.js')
const cors = require('@koa/cors')
const { bodyParser } = require('@koa/bodyparser')

const app = new koa()

app.use(cors())
app.use(bodyParser()) // 让koa可以解析post传递的参数

useRouter(app)


app.listen(3000,()=>{
    console.log('项目已启动');
})